package com.highcom.service.impl;

import com.highcom.dao.BookDao;
import com.highcom.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

@Service("userService")
@Scope("singleton")//作用域
public class UserServiceImpl implements UserService {

    @Autowired //依赖注入
    @Qualifier("bookDao")
    BookDao bookDao;

    @Override
    public void save() {
        System.out.println("UserService  save ... ");
        bookDao.save();
    }
}
